<ul class="comments">
    {% if comments_pager and comments_pager.result %}
        {% for comment in comments_pager.result %}
        <li class="comment">
            {% if comment.comment_type == Constants.COMMENT_TYPE_REPLY %}
                <p class="comment-reply-info">
                    <span class="glyphicon glyphicon-envelope"></span>
                    回复给<strong><i>{{ comment.reply_to_floor }}：</i></strong>
                </p>
            {% end %}
            <div class="comment-thumbnail">
                <img class="img-rounded profile-thumbnail" src="{{ handler.get_gravatar_url(comment.author_email) }}">
                <strong class="comment-floor">{{comment.floor}}楼</strong>
            </div>
            <div class="comment-info">
                <div class="comment-date"><span>{{ comment.create_time.strftime("%Y年%m月%d日 %H:%M:%S") }}</span></div>
                <div class="comment-author">
                    <span>{{ comment.author_name }}</span>
                    {% if comment.rank == Constants.COMMENT_RANK_ADMIN %}
                        <span class="glyphicon glyphicon-user">管理员</span>
                    {% end %}
                </div>
                <div class="comment-content">
                    {% if not comment.disabled or current_user %}
                    <p>{{ comment.content }}</p>
                    {% end %}
                    {% if comment.disabled and current_user %}
                    <p class="disabled-comment-admin-info">
                        <span class="glyphicon glyphicon-remove-sign"></span>
                        <i>该评论已经被管理员屏蔽！访客无法查看和回复此评论内容。</i>
                    </p>
                    {% elif comment.disabled %}
                    <p class="disabled-comment-admin-info">
                        <span class="glyphicon glyphicon-remove-sign"></span>
                        <i>该评论已经被管理员屏蔽！</i>
                    </p>
                    {% end %}
                </div>
            </div>
            <div class="row comment-handle">
                {% if current_user %}
                <div class="col-sm-1 col-sm-offset-8">
                    {% if not comment.disabled %}
                    <button class="btn btn-sm btn-warning" onclick="update_disable('{{ reverse_url("admin.comment.update", article.id, comment.id, "disable")}}')">
                        <span class="glyphicon glyphicon-remove-sign" ></span> 屏蔽
                    </button>
                    {% else %}
                    <button class="btn btn-sm btn-success" onclick="update_disable('{{ reverse_url("admin.comment.update", article.id, comment.id, "enable")}}')">
                        <span class="glyphicon glyphicon-ok-sign"></span> 恢复
                    </button>
                    {% end %}
                </div>
                <div class="col-sm-1 delete-comment">
                    <button class="btn btn-sm btn-danger" onclick="delCommentCfm('{{ reverse_url("admin.comment.update", article.id, comment.id, "delete")}}')">
                        <span class="glyphicon glyphicon-trash"></span> 删除
                    </button>
                </div>
                {% end %}
                {% if not comment.disabled or current_user %}
                <div class="col-sm-1 {% if not current_user %}col-sm-offset-10{% end %}">
                    <button class="btn btn-sm btn-info" onclick="go_to_reply('{{Constants.COMMENT_TYPE_REPLY}}', {{comment.id}}, '{{comment.floor}}楼')">
                        <span class="glyphicon glyphicon-comment"></span> 回复
                    </button>
                </div>
                {% end %}
            </div>
        </li>
        {% end %}
    {% else %}
        <li class="comment">
            <div class="comment-content">暂无评论</div>
        </li>
    {% end %}
</ul>

<!-- 信息删除确认: For delete a comment confirm -->
<div class="modal fade" id="delCommentCfmModel">
    <div class="modal-dialog">
        <div class="modal-content message_align">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <h4 class="modal-title">确认删除评论？</h4>
            </div>
            <div class="modal-body">
                <p>
                    将该评论删除后不可恢复，您确认要删除吗？
                </p>
                <p>
                    （提示：如果您只是不想显示该评论内容，可以选择将其屏蔽，而不必删除。）
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button id="delCommentCfmClick" class="btn btn-success" data-dismiss="modal">确定</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->